package com.eighth.adapter;


public class AdapterTest {
    public static void main(String[] args) {
        PowerA powerA = new PowerAImpl();
        work(powerA);

        PowerB powerB = new PowerBImpl();
        //work(powerB);
        Adapter adapter = new Adapter(powerB);
        work(adapter);
    }

    // 业务方法是已经存在了
    private static void work(PowerA a){
        System.out.println("正在连接...");
        a.insert();
        System.out.println("工作结束.");
    }
}
